package com.zengtengpeng.generator.create.impl;

import com.zengtengpeng.generator.bean.AutoCodeParam;
import com.zengtengpeng.generator.create.CreateCode;

/**
 * 生成基础的增删改查
 */
public class BiSheCreateCode implements CreateCode {

    /**
     * 初始化
     * @param basePackagePath 模板路径
     */
    public BiSheCreateCode(String basePackagePath) {
        cfg.setClassLoaderForTemplateLoading(this.getClass().getClassLoader(),basePackagePath);
    }

    @Override
    public void startAuto( AutoCodeParam param) {
    	createJavaFile("dao",  param);
    	createJavaFile("provider",  param);
        createJavaFile("service",  param);
        createJavaFile("serviceImpl", param);
        createJavaFile("controller",  param);
        System.err.println("表名是："+param.getDataName());
    }
}
